package com.baobaotao.proxy;

import java.lang.reflect.Proxy;

public class TestForumService {

	public static void main(String[] args) {
		//ForumService forumService=new ForumServiceImpl();
		//forumService.removeForum(10);
		ForumService targer=new ForumServiceImpl();
		PerformaceHandler handler=new PerformaceHandler(targer);
        System.out.println("new PerformaceHandler(targer)1");
		ForumService proxy=(ForumService)Proxy.newProxyInstance(targer.getClass().getClassLoader(), targer.getClass().getInterfaces(), handler);
		System.out.println("Proxy.newProxyInstance");
		proxy.removeForum(10);
		proxy.removeTopic(1012);

	}

}
